<template>
	<view class="content mainpadding2">
		<view class="mainpadding_top ffffff border2 radius" v-for="item in list.data" :key="item.id">
			<view class="flexbetween padding_bottom xiahuaxian">
				<view class="color_san text_w">
					{{item.createtime_text}}
				</view>
				<view class="text_w">
					<text style="color: #FD463E;" v-if="item.status==1">待处理</text>
					<text style="color: #50B674;" v-if="item.status==2">已处理</text>
				</view>
			</view>
			<view class="margin_top color_san text_a">{{item.des}}</view>
			<view class="margin_top color_san text_a" v-if="item.remarks">回复：{{item.remarks}}</view>
		</view>
		<view class="flexcenter margin_top" v-if="!list.data.length">
			<image src="/static/placeholderimg.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 10,
				list: {
					data: []
				}
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(isPage, page) {
				httpRequest.request("/api/user/getFeedbackList", 'GET', {
					page: page || 1,
					limit: this.limit
				}, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = this.list;
						if (isPage == true) {
							this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							this.list.data = resList.data;
						}
					}
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.border_bottom_dotted {
		border-bottom: 5rpx dotted rgba(153, 153, 153, 1);
	}

	.imgBox {
		width: 124rpx;
		height: 124rpx;
		border-radius: 16rpx;
		overflow: hidden;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.border_bottom_solid {
		border-bottom: 1rpx solid rgba(153, 153, 153, .1);
	}
</style>